package com.hjx.movie.core.system.runner;

import com.hjx.movie.core.util.cache.CacheUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * <p>Title:</p>
 * <p>Description:</p>
 *
 * @author hjx
 * @date 2021/1/9 - 0:39
 */
@Slf4j
@Component
@Order(value = 1)
public class RedisCacheRunner implements ApplicationRunner {
    @Resource
    CacheUtil cacheUtil;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("启动完成后就会自动调用的RedisCacheRunner");
        cacheUtil.preSaveData();
    }
}
